<div class="bg_greenyellow round_10 quarter shadow_in_0">
    <ul class="rightmenu">
        <li><a href="<?php echo $this->url(array('action'=>'index','controller'=>'commodities','module'=>'admin'),null,true); ?>">Towary</a></li>
        <li><a href="<?php echo $this->url(array('action'=>'categories','controller'=>'commodities','module'=>'admin'),null,true); ?>">Kategorie</a></li>
        <li><a href="<?php echo $this->url(array('action'=>'types','controller'=>'commodities','module'=>'admin'),null,true); ?>">Słownik</a></li>
        <li><a href="<?php echo $this->url(array('action'=>'periods','controller'=>'commodities','module'=>'admin'),null,true); ?>">Terminy Dostaw</a></li>
    </ul>    
</div>
    
    
<div class="threequarter vpad_10 last fixed ">
    
    
   
    <h6 class ="bg_mediumblue round_5 shadow_out_4">Okresy dostaw</h6>
   
   <? if(!empty($this->periods)){ ?> 
    <table class="plain" width="100%">
   <caption>
      Globalnie zdefiniowane okresy dostaw
   </caption>
   <thead>
      <tr>

         <th scope="col">Nazwa</th>
         <th scope="col">Od </th>
         <th scope="col">Do</th>
         <th scope="col"></th>
         <th scope="col"></th>
      </tr>
   </thead>
   <tfoot>
      <tr>

         <th>&nbsp;</th>
         <td>&nbsp;</td>
         <td>&nbsp;</td>
         <td>&nbsp;</td>
         <td>&nbsp;</td>
      </tr>
   </tfoot>
   <?php foreach ($this->periods as $period){ ?>
   <tbody>
      <tr>
         <th scope="row"><?php echo $period->getName();?></th>

         <td><?php echo $this->dateToString($period->getStartTime()); ?></td>
         <td><?php echo $this->dateToString($period->getEndTime());?></td>
         <td><a class="edit_button grey styled_button" href='<?php echo $this->url(array('action'=>'edit-period','controller'=>'commodities','module'=>'admin','id'=>$period->getCalendarPeriod_id()),null,true); ?>'>Edytuj</a></td>
         <td><a class="delete_button grey styled_button" href='<?php echo $this->url(array('action'=>'delete-period','controller'=>'commodities','module'=>'admin','id'=>$period->getCalendarPeriod_id()),null,true); ?>'>Usuń</a></td>
      </tr> 
  <?php } ?>
   </tbody>
</table>
    
    <?php } ?>
    
    <h6 class ="bg_mediumblue round_5 shadow_out_4">Dodaj nowy okres dostaw</h6>
    <?php echo $this->form; ?>
    
    
</div>    